




use "data\data1_regional.dta", clear



	
*******************
******************* Table 1: manufacturing employment

eststo clear

eststo R1: reg d_sh_empl_mfg  D_t_US                   Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R2: reg d_sh_empl_mfg  D_t_US D_t_MEX  Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R3: ivregress 2sls d_sh_empl_mfg   D_t_US D_t_MEX  (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 using "results\w1\t1.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "") 






*******************
******************* Table 3: population

eststo clear

eststo R1: reg lnchg_popworkage  D_t_US D_t_MEX  Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R2: ivregress 2sls lnchg_popworkage  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R3: ivregress 2sls lnchg_popworkage_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R4: ivregress 2sls lnchg_popworkage_edu_c   D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

esttab R1 R2 R3 R4  using "results\w1\t3.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "")  keep(D_t_US D_t_MEX xCHN) 




*******************
******************* Table 4: manufacturing emp, nonmanufacturing emp, total emp, unemp, nilf


eststo clear

***mftg
eststo R1: reg d_sh_empl_mfg  D_t_US D_t_MEX  Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R2: ivregress 2sls d_sh_empl_mfg  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg
eststo R3: reg d_sh_empl_nmfg  D_t_US D_t_MEX  Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R4: ivregress 2sls d_sh_empl_nmfg  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp
eststo R5: reg d_sh_empl  D_t_US D_t_MEX  Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R6: ivregress 2sls d_sh_empl  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp

eststo R7: reg d_sh_unempl  D_t_US D_t_MEX  Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R8: ivregress 2sls d_sh_unempl  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf

eststo R9: reg d_sh_nilf  D_t_US D_t_MEX  Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R10: ivregress 2sls d_sh_nilf  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t4.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")  keep(D_t_US D_t_MEX xCHN) 



*******************
******************* Table 5 -- panel A: no college

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg
eststo R2: ivregress 2sls d_sh_empl_nmfg_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp
eststo R3: ivregress 2sls d_sh_empl_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp
eststo R4: ivregress 2sls d_sh_unempl_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf
eststo R5: ivregress 2sls d_sh_nilf_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 R4 R5 using "results\w1\t5A.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)


*******************
******************* Table 5 -- panel B: college

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_edu_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg

eststo R2: ivregress 2sls d_sh_empl_nmfg_edu_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp

eststo R3: ivregress 2sls d_sh_empl_edu_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp

eststo R4: ivregress 2sls d_sh_unempl_edu_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf

eststo R5: ivregress 2sls d_sh_nilf_edu_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 R4 R5 using "results\w1\t5B.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)



*******************
******************* Table 5 -- panel C: female


eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_f  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg
eststo R2: ivregress 2sls d_sh_empl_nmfg_f  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp
eststo R3: ivregress 2sls d_sh_empl_f  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp

eststo R4: ivregress 2sls d_sh_unempl_f  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf

eststo R5: ivregress 2sls d_sh_nilf_f  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 R4 R5 using "results\w1\t5C.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)





*******************
******************* Table 5 -- panel D: male

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_m  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg
eststo R2: ivregress 2sls d_sh_empl_nmfg_m  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp
eststo R3: ivregress 2sls d_sh_empl_m  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp
eststo R4: ivregress 2sls d_sh_unempl_m  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf
eststo R5: ivregress 2sls d_sh_nilf_m  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 R4 R5 using "results\w1\t5D.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)



 


*******************
******************* Table 6 -- panel A (race: all)

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_nw  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R2: ivregress 2sls d_sh_empl_mfg_w  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg
eststo R3: ivregress 2sls d_sh_empl_nmfg_nw  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R4: ivregress 2sls d_sh_empl_nmfg_w  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp

eststo R5: ivregress 2sls d_sh_empl_nw  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R6: ivregress 2sls d_sh_empl_w  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp

eststo R7: ivregress 2sls d_sh_unempl_nw  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R8: ivregress 2sls d_sh_unempl_w  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf

eststo R9: ivregress 2sls d_sh_nilf_nw  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R10: ivregress 2sls d_sh_nilf_w  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t6A.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)



*******************
******************* Table 6 -- panel B (race: nocollege)


eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_nw_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R2: ivregress 2sls d_sh_empl_mfg_w_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg
eststo R3: ivregress 2sls d_sh_empl_nmfg_nw_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R4: ivregress 2sls d_sh_empl_nmfg_w_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp
eststo R5: ivregress 2sls d_sh_empl_nw_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R6: ivregress 2sls d_sh_empl_w_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp
eststo R7: ivregress 2sls d_sh_unempl_nw_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R8: ivregress 2sls d_sh_unempl_w_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf
eststo R9: ivregress 2sls d_sh_nilf_nw_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R10: ivregress 2sls d_sh_nilf_w_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)




esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t6B.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)




*******************
******************* Table 6 -- panel C (race: college)

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_nw_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R2: ivregress 2sls d_sh_empl_mfg_w_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** non-mftg
eststo R3: ivregress 2sls d_sh_empl_nmfg_nw_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R4: ivregress 2sls d_sh_empl_nmfg_w_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** emp
eststo R5: ivregress 2sls d_sh_empl_nw_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R6: ivregress 2sls d_sh_empl_w_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** unemp
eststo R7: ivregress 2sls d_sh_unempl_nw_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R8: ivregress 2sls d_sh_unempl_w_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

*** nilf
eststo R9: ivregress 2sls d_sh_nilf_nw_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)
eststo R10: ivregress 2sls d_sh_nilf_w_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t6C.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)



*******************
******************* Table 7 -- by industries

eststo clear
eststo R1: ivregress 2sls d_sh_empl_constr D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R2: ivregress 2sls d_sh_empl_trans_util D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R3: ivregress 2sls d_sh_empl_trade D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R4: ivregress 2sls d_sh_empl_other_serv D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R5: ivregress 2sls d_sh_empl_gov D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

esttab R1 R2 R3 R4 R5 using "results\w1\t7.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")  keep(D_t_US D_t_MEX xCHN)


*******************
******************* Table 8 -- panel A (abstract)

eststo clear
** baseline
eststo R1: ivregress 2sls d_sh_empl_abstract D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** baseline no instr
eststo R2: ivregress 2sls d_sh_empl_abstract D_t_US D_t_MEX (xCHN = xOTH  ) l_sh_routine33 Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** nocollege
eststo R3: ivregress 2sls d_sh_empl_nc_abstract D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** college
eststo R4: ivregress 2sls d_sh_empl_c_abstract D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**mfg
eststo R5: ivregress 2sls d_sh_empl_mfg_abstract D_t_US D_t_MEX (xCHN l_sh_routine33_mfg=xOTH R33a_mfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**nmfg
eststo R6: ivregress 2sls d_sh_empl_nmfg_abstract D_t_US D_t_MEX (xCHN l_sh_routine33_nmfg=xOTH R33a_nmfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)



esttab R1 R2 R3 R4 R5 R6 using "results\w1\t8A.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN l_sh_routine33 l_sh_routine33_mfg l_sh_routine33_nmfg)



*******************
******************* Table 8 -- panel B (routine - clerical)

eststo clear
** baseline
eststo R1: ivregress 2sls d_sh_empl_clerical D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** baseline no instr
eststo R2: ivregress 2sls d_sh_empl_clerical D_t_US D_t_MEX (xCHN = xOTH  ) l_sh_routine33 Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** nocollege
eststo R3: ivregress 2sls d_sh_empl_nc_clerical D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** college
eststo R4: ivregress 2sls d_sh_empl_c_clerical D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**mfg
eststo R5: ivregress 2sls d_sh_empl_mfg_clerical D_t_US D_t_MEX (xCHN l_sh_routine33_mfg=xOTH R33a_mfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**nmfg
eststo R6: ivregress 2sls d_sh_empl_nmfg_clerical D_t_US D_t_MEX (xCHN l_sh_routine33_nmfg=xOTH R33a_nmfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)


esttab R1 R2 R3 R4 R5 R6 using "results\w1\t8B.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN l_sh_routine33 l_sh_routine33 l_sh_routine33_mfg l_sh_routine33_nmfg)


*******************
******************* Table 8 -- panel C (routine - production)

eststo clear
** baseline
eststo R1: ivregress 2sls d_sh_empl_production D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** baseline no instr
eststo R2: ivregress 2sls d_sh_empl_production D_t_US D_t_MEX (xCHN = xOTH  ) l_sh_routine33 Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** nocollege
eststo R3: ivregress 2sls d_sh_empl_nc_production D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** college
eststo R4: ivregress 2sls d_sh_empl_c_production D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**mfg
eststo R5: ivregress 2sls d_sh_empl_mfg_production D_t_US D_t_MEX (xCHN l_sh_routine33_mfg=xOTH R33a_mfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**nmfg
eststo R6: ivregress 2sls d_sh_empl_nmfg_production D_t_US D_t_MEX (xCHN l_sh_routine33_nmfg=xOTH R33a_nmfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)


esttab R1 R2 R3 R4 R5 R6 using "results\w1\t8C.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN l_sh_routine33 l_sh_routine33 l_sh_routine33_mfg l_sh_routine33_nmfg)

*******************
******************* Table 8 -- panel D (manual)



eststo clear
** baseline
eststo R1: ivregress 2sls d_sh_empl_manual D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** baseline no instr
eststo R2: ivregress 2sls d_sh_empl_manual D_t_US D_t_MEX (xCHN = xOTH  ) l_sh_routine33 Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** nocollege
eststo R3: ivregress 2sls d_sh_empl_nc_manual D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
** college
eststo R4: ivregress 2sls d_sh_empl_c_manual D_t_US D_t_MEX (xCHN l_sh_routine33=xOTH R33a_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**mfg
eststo R5: ivregress 2sls d_sh_empl_mfg_manual D_t_US D_t_MEX (xCHN l_sh_routine33_mfg=xOTH R33a_mfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)
**nmfg
eststo R6: ivregress 2sls d_sh_empl_nmfg_manual D_t_US D_t_MEX (xCHN l_sh_routine33_nmfg=xOTH R33a_nmfg_1950_90 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_task_outsource i.div [aw=timepwt48] , cluster(statefip)


esttab R1 R2 R3 R4 R5 R6 using "results\w1\t8D.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN l_sh_routine33 l_sh_routine33 l_sh_routine33_mfg l_sh_routine33_nmfg)




*******************
******************* Table 9 ; panel A; low human capital

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)

*** non-mftg
eststo R2: ivregress 2sls d_sh_empl_nmfg  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)

*** emp
eststo R3: ivregress 2sls d_sh_empl  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)

*** unemp
eststo R4: ivregress 2sls d_sh_unempl  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)

*** nilf
eststo R5: ivregress 2sls d_sh_nilf  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)



*******************
******************* Table 9 ; panel A; high human capital

***mftg
eststo R6: ivregress 2sls d_sh_empl_mfg  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)

*** non-mftg
eststo R7: ivregress 2sls d_sh_empl_nmfg  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)

*** emp
eststo R8: ivregress 2sls d_sh_empl  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)

*** unemp
eststo R9: ivregress 2sls d_sh_unempl  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)

*** nilf
eststo R10: ivregress 2sls d_sh_nilf  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)


esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t9A.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)






*******************
******************* Table 9 ; panel B; no college; low human capital

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** non-mftg
eststo R2: ivregress 2sls d_sh_empl_nmfg_edu_nc D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** emp
eststo R3: ivregress 2sls d_sh_empl_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** unemp
eststo R4: ivregress 2sls d_sh_unempl_edu_nc D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** nilf
eststo R5: ivregress 2sls d_sh_nilf_edu_nc D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)

*******************
******************* Table 9 ; panel B; no college; high human capital

***mftg
eststo R6: ivregress 2sls d_sh_empl_mfg_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** non-mftg
eststo R7: ivregress 2sls d_sh_empl_nmfg_edu_nc D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** emp
eststo R8: ivregress 2sls d_sh_empl_edu_nc  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** unemp
eststo R9: ivregress 2sls d_sh_unempl_edu_nc D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** nilf
eststo R10: ivregress 2sls d_sh_nilf_edu_nc D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)


* nocollege
esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t9B.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)



*******************
******************* Table 9 ; panel C; college; low human capital

eststo clear

***mftg
eststo R1: ivregress 2sls d_sh_empl_mfg_edu_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** non-mftg
eststo R2: ivregress 2sls d_sh_empl_nmfg_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** emp
eststo R3: ivregress 2sls d_sh_empl_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** unemp
eststo R4: ivregress 2sls d_sh_unempl_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)
*** nilf
eststo R5: ivregress 2sls d_sh_nilf_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 0 , cluster(statefip)


*******************
******************* Table 9 ; panel C; college; high human capital

***mftg
eststo R6: ivregress 2sls d_sh_empl_mfg_edu_c  D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** non-mftg
eststo R7: ivregress 2sls d_sh_empl_nmfg_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** emp
eststo R8: ivregress 2sls d_sh_empl_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** unemp
eststo R9: ivregress 2sls d_sh_unempl_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)
*** nilf
eststo R10: ivregress 2sls d_sh_nilf_edu_c D_t_US D_t_MEX (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] if HHC == 1 , cluster(statefip)



* college
esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t9C.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX xCHN)






******************* Table 10
******************* 

eststo clear

** mftg emp
eststo R1: ivregress 2sls d_sh_empl_mfg   D_t_US D_t_MEX  (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R2: ivregress 2sls d_sh_empl_mfg1990_2007 D_t_US D_t_MEX  (xCHN_90_07 = xOTH_90_07 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

** nmftg emp
eststo R3: ivregress 2sls d_sh_empl_nmfg   D_t_US D_t_MEX  (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R4: ivregress 2sls d_sh_empl_nmfg1990_2007 D_t_US D_t_MEX  (xCHN_90_07 = xOTH_90_07 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


** total emp
eststo R5: ivregress 2sls d_sh_empl D_t_US D_t_MEX  (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R6: ivregress 2sls d_sh_empl1990_2007 D_t_US D_t_MEX  (xCHN_90_07 = xOTH_90_07 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


** unemp
eststo R7: ivregress 2sls d_sh_unempl D_t_US D_t_MEX  (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R8: ivregress 2sls d_sh_unempl1990_2007 D_t_US D_t_MEX  (xCHN_90_07 = xOTH_90_07 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

** nilf
eststo R9: ivregress 2sls d_sh_nilf D_t_US D_t_MEX  (xCHN=xOTH) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)

eststo R10: ivregress 2sls d_sh_nilf1990_2007 D_t_US D_t_MEX  (xCHN_90_07 = xOTH_90_07 ) Lsh_manuf l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.div [aw=time] , cluster(statefip)


esttab R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 using "results\w1\t10.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "" "" "" "" "")   keep(D_t_US D_t_MEX)









*******************
******************* Table 2.

use "data\data2_regional_lagged.dta", clear


** OLS
eststo clear

*** 70-80
eststo R1: reg d_sh_empl_mfg D_t_US D_t_MEX [aw=timepwt48] if yr==1970, cluster(statefip)

*** 80-90
eststo R2: reg d_sh_empl_mfg D_t_US D_t_MEX [aw=timepwt48] if yr==1980, cluster(statefip)

*** 70-90
eststo R3: reg d_sh_empl_mfg D_t_US D_t_MEX i.yr [aw=timepwt48] if yr==1970 | yr == 1980, cluster(statefip)


esttab R1 R2 R3  using "results\w1\t2.tex", replace se obs star(* 0.10 ** 0.05 *** 0.01) label nocons nogaps b(%9.3f) se(%9.3f)  ///
mtitle("" "" "" "" "" "") keep(D_t_US D_t_MEX) 












